package com.library.model.daoimple;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.library.model.dao.UserDAO;
import com.library.model.dto.user.UserDTO;

public class UserDAOImple extends SqlMapClientDaoSupport implements UserDAO{

	@Override
	public List<UserDTO> getAllUser() {
		return (List<UserDTO>)getSqlMapClientTemplate().queryForList("UserMap.getAllUser");
	}

	@Override
	public UserDTO getUser(String id) {
		return (UserDTO)getSqlMapClientTemplate().queryForObject("UserMap.getUser",id);
	}

	@Override
	public void updateUser(UserDTO dto) {
		getSqlMapClientTemplate().update("UserMap.updateUser",dto);
	}

	@Override
	public void deleteUser(String id) {
		getSqlMapClientTemplate().delete("UserMap.deleteUser",id);
	}

}
